package cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.policies;

import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;

import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.commands.CompositeComponent2CreateCommand;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.commands.Interface2CreateCommand;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.commands.SimpleComponent2CreateCommand;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.providers.ComponentBasedSystemElementTypes;

/**
 * @generated
 */
public class CompositeComponentCompositeComponentCompartment2ItemSemanticEditPolicy
		extends ComponentBasedSystemBaseItemSemanticEditPolicy {

	/**
	 * @generated
	 */
	public CompositeComponentCompositeComponentCompartment2ItemSemanticEditPolicy() {
		super(ComponentBasedSystemElementTypes.CompositeComponent_3002);
	}

	/**
	 * @generated
	 */
	protected Command getCreateCommand(CreateElementRequest req) {
		if (ComponentBasedSystemElementTypes.SimpleComponent_3001 == req
				.getElementType()) {
			return getGEFWrapper(new SimpleComponent2CreateCommand(req));
		}
		if (ComponentBasedSystemElementTypes.CompositeComponent_3002 == req
				.getElementType()) {
			return getGEFWrapper(new CompositeComponent2CreateCommand(req));
		}
		if (ComponentBasedSystemElementTypes.Interface_3003 == req
				.getElementType()) {
			return getGEFWrapper(new Interface2CreateCommand(req));
		}
		return super.getCreateCommand(req);
	}

}
